<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <link href="__PUBLIC__/js/themes/default/easy_ui.css" rel="stylesheet" type="text/css" />
        <link href="__PUBLIC__/js/themes/icon.css" rel="stylesheet" type="text/css" />
        <link href="__PUBLIC__/css/demo.css" rel="stylesheet" type="text/css" />
        <script src="__PUBLIC__/js/jquery-1.8.0.min.js" type="text/javascript"></script>
        <script src="__PUBLIC__/js/jquery.easyui.min.js" type="text/javascript"></script>
        <script charset="utf-8" src="__PUBLIC__/editor/kindeditor.js"></script>
        <script charset="utf-8" src="__PUBLIC__/editor/lang/zh_CN.js"></script>
        <script type="text/javascript">
            KindEditor.ready(function(K) {
                //  window.editor = K.create('#txtArea');
                K.create('#txtArea', {
                    uploadJson: "{:U('BuildingInformation/uploadImage')}",
                    allowFileManager: false,
                    afterCreate: function() {
                        this.sync();
                    },
                    afterBlur: function() {
                        this.sync();
                    }, items : [

       'fullscreen', 'undo', 'redo','cut', 'copy', 'paste',

        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',

        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',

        'superscript', '|', 'selectall', '-',

        'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',

        'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',

        'flash', 'media', 'advtable'
         ]
                });
            });

            function SaveHtml()  {
                 var htmls=$("#txtArea").val();
                  $.ajax({
                    url: "{:U('BuildingInformation/saveBuildingInformationHTML')}",
                    type: "POST",
                    cache: true,
                    dataType:"json",
                    data: {htmlData: htmls,htmlDataID:$("#hId").val()},
                    success: function(data) {
                        //   document.write(TreeDataStr);return;
                        if (data.error == '0') {
                            $("#hId").val(data.ID);
                            alert("保存成功!");
                            return;
                        }
                        else {
                            alert("保存失败!");
                            return;
                        }
                    }
                });
            }
        </script>
    </head>
    <body>
        <div data-options="region:'center',title:'楼宇资讯'">
            <input type="hidden" id="hId" value="{$vo.ID}" />
            <textarea id="txtArea" style="width:662px;height:631px;">{$vo.HtmlContent}</textarea><br/><br/>
            <a id="btnSave" href="javascript:void(0)" onclick='SaveHtml()' class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
        </div> 
    </body>
</html>
